const API = require('../../pages/api/index')
const { typeJson } = require('../../utils/typejson')
let prolist = wx.getStorageSync('prolist')==''?wx.getStorageSync('prolist'):JSON.parse(wx.getStorageSync('prolist'))

Page({

  /**
   * 页面的初始数据
   */
  data: {
    pulldown:"",
    pullup:2,
    addButton:true,
    Refresh:false,
    prolist:wx.getStorageSync('prolist')==''?wx.getStorageSync('prolist'):JSON.parse(wx.getStorageSync('prolist')),
    
    listConfig: [
        {
          label: '班组',
          prop: 'orgName'
        },
   
        {
          label: '安全检查日期',
          prop: 'safeTime',
        }
      ],
      slide: {
        slideButton: {
          text: '编辑',
          extClass: 'test',
            src: '/page/weui/cell/icon_star.svg', // icon的路径
        },
        formConfig: [ 
       
          {
            label: '日期',
            prop: 'safeTime',
            type:"dateTime"
          },
          {
            label: '地点',
            prop: 'place',
          },
          {
            label: '班组',
            prop: 'orgName',
            hidden: 'edit',
          },
          {
            label: '班组',
            prop: 'classGroup',
            type: 'multiDropDown',
            required:true,
            hidden: 'look',
            net: {
              url: '/app/siteMeeting/getDepartList',
              method: 'post',
              data:{
                mineId: true,
                
              },
              key: 'id',
              value: 'orgName'
            }
          },
          {
            label: '班组长',
            prop: 'classMan',
            hidden: 'edit',
          },
          {
            label: '班组长',
            prop: 'classManId',
            type: 'multiDropDown',
            required:true,
            hidden: 'look',
            net: {
              url: '/app/memberinfo/getList',
              method: 'post',
              data:{
                mineId: true,
                
              },
              key: 'memberId',
              value: 'nickName'
            }
          },
    
          {
            label: '安全员',
            prop: 'safeMan',
            hidden: 'edit',
          },
          {
            label: '安全员',
            prop: 'safeManId',
            type: 'multiDropDown',
            required:true,
            hidden: 'look',
            net: {
              url: '/app/memberinfo/getList',
              method: 'post',
              data:{
                mineId: true,
                
              },
              key: 'memberId',
              value: 'nickName'
            }
          },
        
          {
            label: '是否按设计参数布置施工作业',
            prop: 'isOperation',
            type: 'box',
            checked:0,
            
          },
          {
            label: '是否按操作规范作业',
            type: 'box',
            checked:0,
            type: 'dropDown',
            
          },
          {
            label: '工作质量与进度是否符合要求',
            prop: 'isGood',
            type: 'boxsd',
            checked:0,
            
          },
          {
            label: '是否有三违行为',
            prop: 'isThree',
            type: 'box',
            checked:0,
            
          },
          {
            label: '是否按要求进行警戒',
            prop: 'isWaring',
            type: 'box',
            checked:0,
            
          },
          {
            label: '安全设备设施是否正常使用',
            prop: 'isSafe',
            type: 'box',
            checked:0,
            
          },
          {
            label: '是否有跑冒滴漏情况',
            prop: 'isWater',
            type: 'box',
            checked:0,
            
          },
          {
            label: '是否有异响',
            prop: 'isNoise',
            type: 'box',
            checked:0,
            
          },
          {
            label: '电流电压温度是否正常',
            prop: 'isTemperature',
            type: 'box',
            checked:0,
            
          },
          {
            label: '润滑系统液压系统是否正常',
            prop: 'isSystem',
            type: 'box',
            checked:0,
            
          },
          {
            label: '是否清理现场',
            prop: 'isClean',
           type: 'box',
            checked:0,
            
          },
          {
            label: '是否清晰交代未完成或隐患排查工作',
            prop: 'isHand',
           type: 'box',
            checked:0,
            
          },
          {
            label: '是否按要求清退器材设备物资',
            prop: 'isRetreat',
           type: 'box',
            checked:0,
            
          },
          {
            label: '排查处理的隐患',
            prop: 'content',
            type:"textarea",
          },
          {
            label: '班组长签字',
            prop: 'classManSign',
            type:"canvas"
          },
          {
            label: '安全员签字',
            prop: 'safeManSign',
            type:"canvas"
          },
  
          ],
      },
 
      formConfig: [
       
        {
          label: '日期',
          prop: 'safeTime',
          type:"dateTime",
          required:true,
        },
        {
          label: '地点',
          prop: 'place',
   
        },
        {
          label: '班组',
          prop: 'orgName',
          hidden: 'edit',
          required:true,
        },
        {
          label: '班组',
          prop: 'classGroup',
          type: 'dropDownSearch',
          required:true,
          hidden: 'look',
          net: {
            url: '/app/siteMeeting/getDepartList',
            method: 'post',
            data:{
              mineId: true,
              
            },
            key: 'orgName',
            value: 'id'
          }
        },
        {
          label: '班组长',
          prop: 'classMan',
          hidden: 'edit',
        },
        {
          label: '班组长',
          prop: 'classManId',
          type: 'multiDropDown',
          required:true,
          hidden: 'look',
          net: {
            url: '/app/memberinfo/getList',
            method: 'post',
            data:{
              mineId: true,
              
            },
            key: 'memberId',
            value: 'nickName'
          }
        },
  
        {
          label: '安全员',
          prop: 'safeMan',
          hidden: 'edit',
        },
        {
          label: '安全员',
          prop: 'safeManId',
          type: 'multiDropDown',
          required:true,
          hidden: 'look',
          net: {
            url: '/app/memberinfo/getList',
            method: 'post',
            data:{
              mineId: true,
              
            },
            key: 'memberId',
            value: 'nickName'
          }
        },
      
        {
          label: '是否按设计参数布置施工作业',
          prop: 'isOperation',
          type: 'box',
            checked:0,
         
        },
        {
          label: '是否按操作规范作业',
          prop: 'isOption',
          type: 'box',
            checked:0,
         
        },
        {
          label: '工作质量与进度是否符合要求',
          prop: 'isGood',
          type: 'boxsd',
          checked:0,
         
        },
        {
          label: '是否有三违行为',
          prop: 'isThree',
          type: 'box',
            checked:0,
         
        },
        {
          label: '是否按要求进行警戒',
          prop: 'isWaring',
          type: 'box',
            checked:0,
         
        },
        {
          label: '安全设备设施是否正常使用',
          prop: 'isSafe',
          type: 'box',
            checked:0,
         
        },
        {
          label: '是否有跑冒滴漏情况',
          prop: 'isWater',
          type: 'box',
            checked:0,
         
        },
        {
          label: '是否有异响',
          prop: 'isNoise',
          type: 'box',
            checked:0,
         
        },
        {
          label: '电流电压温度是否正常',
          prop: 'isTemperature',
          type: 'box',
            checked:0,
         
        },
        {
          label: '润滑系统液压系统是否正常',
          prop: 'isSystem',
          type: 'box',
            checked:0,
         
        },
        {
          label: '是否清理现场',
          prop: 'isClean',
          type: 'box',
            checked:0,
         
        },
        {
          label: '是否清晰交代未完成或隐患排查工作',
          prop: 'isHand',
          type: 'box',
            checked:0,
         
        },
        {
          label: '是否按要求清退器材设备物资',
          prop: 'isRetreat',
          type: 'box',
            checked:0,
         
        },
        {
          label: '排查处理的隐患',
          prop: 'content',
          type:"textarea",
        },
        {
          label: '班组长签字',
          prop: 'classManSign',
          type:"canvas",
        },
        {
          label: '安全员签字',
          prop: 'safeManSign',
          type:"canvas",
        },

        ],
    
        
        net: {
       
            select: {
              url: `/app/lineCheck/getList`,
              method: 'post',
              data: {
                mineId: true,
                
              }
            },
            delete: {
              url: '/app/lineCheck/delete',
              method: 'post',
              data: {
                
              }
            },
            insert: {
              url: '/app/lineCheck/edit',
              method: 'post',
              data: {
                mineId:true,
               
              }
            },
            update: {
              url: '/app/lineCheck/edit',
              method: 'post',
              data: {
  
              }
            } 
        },
        showCom:true
      },

     
  

  /**
   * 生命周期函数--监听页面加载
   */


  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },
  
  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
   
    
    this.setData({
      showCom:false
    })

    this.setData({
      showCom:true
    })
  },

 

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
    wx.showLoading({
      title: '刷新中...',
    })
    this.setData({
      Refresh:true
    })
    wx.hideLoading();
    wx.stopPullDownRefresh()
    this.setData({
      Refresh:false
    })
  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
    this.setData({
      pullup: this.data.pullup + 1
    })
  },


  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})